import java.util.ArrayList;
import java.util.List;

class Solution206_2 {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>() ;
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(1 , 4) ;
        System.out.println(list);
        
    }
    public ListNode reverseList(ListNode head) {


         if(head == null || head.next ==null) return head ;

          ListNode newHead = reverseList(head.next) ; 
          head.next.next = head ;
          head.next = null ; 
          return newHead ;
    }
}